﻿using Sidvall.Net.Mime;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace Sidvall.Net
{
    public interface IHttpClient : System.IDisposable
    {
        bool AllowAutoRedirect { get; set; }
        bool? UseDefaultCredentials { get; set; }
        AuthenticationHeader AuthenticationHeader { get; set; }
        string BaseAddress { get; set; }
        RangeHeaderValue Range { get; set; }
        MediaTypeHeaderCollection ResponseTypes { get; }
        System.TimeSpan Timeout { get; set; }
        NameValueHeaderValueCollection CustomHeaders { get; }

        Task<HttpResponse> DeleteAsync(System.Uri requestUri, CancellationToken cancellationToken);

        Task<HttpResponse> GetAsync(System.Uri requestUri, HttpCompletionOption completionOption, CancellationToken cancellationToken);

        Task<HttpResponse> PostAsync(System.Uri requestUri, string json, CancellationToken cancellationToken);
        Task<HttpResponse> PostAsync(System.Uri requestUri, string content, MediaType mediaType, CancellationToken cancellationToken);
        Task<HttpResponse> PostAsync(System.Uri requestUri, Dictionary<string, string> form, CancellationToken cancellationToken);
        Task<HttpResponse> PostAsync(System.Uri requestUri, System.IO.Stream content, int bufferSize, CancellationToken cancellationToken);

        Task<HttpResponse> PutAsync(System.Uri requestUri, string json, CancellationToken cancellationToken);
        Task<HttpResponse> PutAsync(System.Uri requestUri, string content, MediaType mediaType, CancellationToken cancellationToken);
        Task<HttpResponse> PutAsync(System.Uri requestUri, Dictionary<string, string> form, CancellationToken cancellationToken);
        Task<HttpResponse> PutAsync(System.Uri requestUri, System.IO.Stream content, int bufferSize, CancellationToken cancellationToken);

        Task<HttpResponse> SendAsync(System.Uri requestUri, HttpMethod method, HttpCompletionOption completionOption, CancellationToken cancellationToken);
        Task<HttpResponse> SendAsync(System.Uri requestUri, HttpMethod method, string json, HttpCompletionOption completionOption, CancellationToken cancellationToken);
        Task<HttpResponse> SendAsync(System.Uri requestUri, HttpMethod method, string content, MediaType mediaType, HttpCompletionOption completionOption, CancellationToken cancellationToken);
        Task<HttpResponse> SendAsync(System.Uri requestUri, HttpMethod method, Dictionary<string, string> form, HttpCompletionOption completionOption, CancellationToken cancellationToken);
        Task<HttpResponse> SendAsync(System.Uri requestUri, HttpMethod method, System.IO.Stream content, int bufferSize, HttpCompletionOption completionOption, CancellationToken cancellationToken);
    }
}
